/*
 * FarmControl.cpp
 *
 *  Created on: 2013-1-22
 *      Author: heqiu
 */

#include "Global.h"

void FarmControl::mouseUp(uint16_t uiX, uint16_t uiY) {
	//m_ControlAddBuilding.m_bShow = true;
}
void FarmControl::mouseDown(uint16_t uiX, uint16_t uiY) {
	if (m_ControlAddBuilding.bPointIn(uiX, uiY)) {
		//m_ControlAddBuilding.m_bShow = false;
		if (m_pAddBuilding == NULL) {
			m_pAddBuilding = new UnitBuilding();
			m_pAddBuilding->setSurface(
					g_GlobalData.g_BuildingTypeManager.m_mapPtr[1]->m_pGuudSurface);
			m_pAddBuilding->m_stPos.m_iX = 25;
			m_pAddBuilding->m_stPos.m_iY = 36;
		}
	} else {
		if (m_pAddBuilding != NULL) {
			delete m_pAddBuilding;
			m_pAddBuilding = NULL;
		}
	}
}
